package com.sayimo.maker.user.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sayimo.framework.database.mybatis.AbstractMybatisBaseDao;
import com.sayimo.framework.exception.DaoException;
import com.sayimo.maker.user.dao.EnterpriseWalletInterfaceDao;
import com.sayimo.maker.user.vo.EnterpriseWallet;

/**  
 * @Title: WalletInterfaceImplDao.java
 * @Package com.sayimo.maker.user.dao.impl
 * @Description: 
 * @author 田超
 * @date 2017年2月10日 下午5:05:54
 * @version V1.0  
 */
@Repository("enterpriseWalletInterfaceDao")
public class EnterpriseWalletInterfaceImplDao extends AbstractMybatisBaseDao<EnterpriseWallet> implements EnterpriseWalletInterfaceDao{
	
	/**
	 * 
	* @Title: updateWallet
	* @Author: 田超
	* @Date:日期：2017年2月8日 : 下午4:00:08
	* @Description:更新钱包
	* @return Integer
	* @Version 1.0.0
	 */
	public Integer updateWallet(EnterpriseWallet wallet) throws DaoException{
		return this.mybatisInterfaceBaseDao.update("com.sayimo.maker.user.dao.EnterpriseWalletInterfaceDao.updateWallet",wallet);
	}	
	public int insertWallet(EnterpriseWallet wallet) throws DaoException {
		return this.mybatisInterfaceBaseDao.insert("com.sayimo.maker.user.dao.EnterpriseWalletInterfaceDao.insertWallet", wallet);
	}

	public EnterpriseWallet queryWalletByCustomerId(int providerRefId) throws DaoException {
		return this.mybatisInterfaceBaseDao.get("com.sayimo.maker.user.dao.EnterpriseWalletInterfaceDao.queryWalletByCustomerId", providerRefId);
	}
	@Override
	public List<Object> queryAllBankBranch(String code, String bankCode) throws DaoException {
		Map<String,Object> param = new HashMap<>();
		param.put("code", code);
		param.put("bankCode", bankCode);
		return this.mybatisInterfaceBaseDao.queryObject("com.sayimo.maker.user.dao.EnterpriseWalletInterfaceDao.getAllBranchBank", param);
	}

	
}
